0bbe5b
@@ -165,6 +165,9 @@
public int read(final byte[] dest, final int offs, final int len)
         if (this.in == null) {
             throw new IOException("stream closed");
         }
+        if (len == 0) {
+            return 0;
+        }
 
         final int hi = offs + len;
         int destOffs = offs;
